//
//  StoryInfoView.m
//  兼职页面
//
//  Created by kuiyuan liang on 2021/6/7.
//

#import "StoryInfoView.h"
#import "CommonUtil.h"

@interface StoryInfoView()

@property (strong, nonatomic) UILabel *label1;
@property (strong, nonatomic) UILabel *label2;
@property (strong, nonatomic) UILabel *updateLabel;
@property (strong, nonatomic) UILabel *readLabel;
@end

@implementation StoryInfoView


-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.label1];
        [self addSubview:self.label2];
        [self addSubview:self.updateLabel];
        [self addSubview:self.readLabel];
    }
    return self;
}

-(UILabel *)label1{
    if (!_label1) {
        _label1 = [[UILabel alloc] initWithFrame:CGRectMake(AD(15), AD(10) ,AD(150), AD(25))];
        _label1.textColor = RGB(87, 87, 87);
        _label1.font = [UIFont systemFontOfSize:AD(15)];
        _label1.text = @"作者:管理员";
    }
    return _label1;
}

-(UILabel *)label2{
    if (!_label2) {
        _label2 = [[UILabel alloc] initWithFrame:CGRectMake(AD(15), _label1.bottom ,AD(250), AD(25))];
        _label2.textColor = RGB(183, 183, 183);
        _label2.font = [UIFont systemFontOfSize:AD(15)];
        _label2.text = @"时间:2021-06-05 10:19";
    }
    return _label2;
}

-(UILabel *)updateLabel{
    if (!_updateLabel) {
        _updateLabel = [[UILabel alloc] initWithFrame:CGRectMake(AD(15), _label1.top ,AD(60), AD(25))];
        _updateLabel.textColor = RGB(255, 16, 35);
        _updateLabel.font = [UIFont systemFontOfSize:AD(15)];
        _updateLabel.text = @"已更新";
        _updateLabel.textAlignment = NSTextAlignmentCenter;
        _updateLabel.right = self.width-AD(10);
        _updateLabel.layer.borderColor = RGB(255, 16, 35).CGColor;
        _updateLabel.layer.borderWidth = AD(1);
    }
    return _updateLabel;
}

-(UILabel *)readLabel{
    if (!_readLabel) {
        _readLabel = [[UILabel alloc] initWithFrame:CGRectMake(AD(15), _label1.bottom ,AD(250), AD(25))];
        _readLabel.textColor = RGB(183, 183, 183);
        _readLabel.font = [UIFont systemFontOfSize:AD(15)];
        _readLabel.text = @"阅读:62617次";
        _readLabel.textAlignment = NSTextAlignmentRight;
        _readLabel.right = self.width-AD(10);
    }
    return _readLabel;
}


@end
